<div ng-include="sys_html('common/_header')"></div>
<style>
	.fui-page{background:#f2f2f2}
    .fui-cell-group{width:100%;border-radius: 0.5rem;}
    .fullback-title{color:#999999;font-size:0.7rem;padding:0.75rem 0 0.5rem 0;}
    .fullback-info{}
    .fullback-info p{height:1rem;line-height: 1rem;font-size:0.625rem;color:#333;display: inline-block;padding:0 0.5rem 0 0;}
    .fullback-info p i{border:none;height:0.75rem;width:0.75rem;display: inline-block;background: #ff4753;color:#fff;font-size:0.4rem;line-height: 0.8rem;text-align: center;
        font-style: normal;border-radius: 0.75rem;-webkit-border-radius: 0.75rem;margin-right:0.25rem;}
    .fullback-remark{line-height: 1rem;font-size:0.6rem;color:#666;padding:0.2rem 0;}
	.fui-tab:after {
		height: 0;
	}
.right-living {height:1.2rem;line-height:1.15rem}
.fui-navbar .cartbtn {padding-right:0.3rem;background:#fff;opacity:1}
.fui-navbar .buybtn  {padding-left:0.3rem;background:#fff}
.fee-tag-nav, .fee-tagup-nav, .fee-disabled-nav {border-radius:1rem;height:2rem;line-height:1.95rem;color:#fff;width:100%;font-weight:400;font-size:0.7rem;margin:0.2rem 0;padding:0 0.2rem}
.fee-tagup {background:{{main.syscolor || 'red'}};color:#fff;width:auto;font-weight:400;font-size:0.55rem}
.fee-tag-nav {background:{{main.syscolor || 'red'}}; opacity: 0.68;}
.fee-tagup-nav {background:{{main.syscolor || 'red'}};}
.fee-disabled-nav {background:#bbb;color:#fff;}	
.arrow-top {
  width: 0;   
  height: 0;   
  border-left: 10px solid transparent; 
  border-right: 10px solid transparent;
  border-bottom: 10px solid #f1e8d6; 
  font-size: 0;  
  line-height: 0;
  margin-left:1.3rem
}
.coutag {padding:0.1rem 0.2rem;background:#ffedef;color:#db2e2a;font-size:0.55rem;border-radius: 0.2rem;}
.fui-tab.fui-tab-danger a.active {
   border-bottom: 0 solid transparent;
}
.fui-tab.fui-tab-danger a.active {
    color: {{main.syscolor || 'red'}};
}
.jylabels {
    display: inline;
    padding: 0.2rem 1.0rem 0.2rem;
    margin: 0 0.5rem 0 0;
    font-size: 0.65rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    float: left;
    border-radius: 0.2rem;
}
</style>
<link rel="stylesheet" href="../core/resource/components/swiper/swiper.min.css">
<div ng-if="pagedata.account" id="jyindex" class='fui-page fui-page-current  page-goods-detail' id='page-goods-detail-index'>
	<div ng-if="main.isapp!=1" ng-click="pagedata.showshareall=true" class="right-living" style="position: fixed;bottom:70%; border: 0 solid #ededed;padding-left:0.4rem;padding-right:0.2rem">
	   <span class="icon jinyunicon icon-fenxiang2" style="font-size:0.65rem;margin:0"></span> 分享
	</div>
	<!-- 找不到宝贝 -->
    <div ng-if="!pagedata.goods"  class="fui-header">
        <div class="fui-header-left">
            <a class="back" id="btn-back"></a>
        </div>
        <div class="title">
            找不到宝贝
        </div>
    </div>
<!-- 商品其他开始 -->
<div class="fui-content basic-block pulldown" style="top: 0.0rem;background:#fff">
<div class="jy-content" style="background:#fff;padding-bottom:3rem">
<div ng-if="!pagedata.goods" class='content-empty'>
    <i class='icon jinyunicon icon-search'></i><br/> 宝贝找不到了~ 您看看别的吧 ~<br/><a href="javascript:;" ng-click="access_json('jy_weishop/goods.index/')" class='btn btn-default-o external'>到处逛逛</a>
</div>
<i ng-if="pagedata.goods.qrcodeshare > 0" class="icon icon-qrcode" id="alert-click"></i>
<div class="fui-cell-group" style="padding:0.5rem;border-radius:0.5rem;border: 1px solid #eee;background:#f6faf9">
			<div class="fui-cell" style="padding:0">
				<div class="fui-cell-label" style="width:2.3rem;">
					<img style="border-radius: 50%;width:2rem;height:2rem" ng-src="{{tomedia(pagedata.shopset.logo) || '../core/resource/images/gw-user.png'}}" />
				</div>
				<div class="fui-cell-info" style="font-size:0.7rem;">
					<div class="bold">{{pagedata.shopset.title}}</div>
					<div class="subtitle" style="font-size:0.6rem">{{pagedata.shopset.desc}}</div>
					<div style="position: relative;width:100%;overflow-y: hidden;">
					<div class="fui-tab-scroll" style="height: auto">
						<div class="fui-icon-col" ng-repeat="item in pagedata.hot_list" ng-click="access_json('jy_weishop/goods.detail//id='+item.id)" style="width:1.8rem;text-align:center;padding:.1rem;margin-bottom:0">
							<div class="weui_cells_radio3" style="width:100%">
								<img class="img-circle"  src="{{tomedia(item.image) || '../core/resource/images/nopic.jpg'}}" style="width:1.6rem;height:1.4rem">
							</div>
						</div>
					</div>
					</div>
				</div>
			</div>		
</div>
<div class="fui-tab fui-tab-danger">
	<a ng-class="{'external active':pagedata.showtype == '0'}" href="javascript:" ng-click="pagedata.showtype='0';">详情</a>
	<a ng-class="{'external active':pagedata.showtype == '4'}" href="javascript:" ng-click="pagedata.showtype='4';">服务须知</a>
</div>
<div ng-if="pagedata.showtype!=4">
<!--轮播图-->
<div class="carousel-inner" role="listbox" style="max-height:20rem">
	<a href="javascript:;" ng-click="previewImage(pagedata.goods.imagetop);">
		<img class="radius" ng-src="{{tomedia(pagedata.goods.imagetop) || '../core/resource/images/nopic.jpg'}}" style="display: block; width: 100%; height: 100%;">
	</a>
</div>
<div ng-if="pagedata.goods" class="fui-cell-group fui-detail-group" style="border-top-left-radius:0;border-top-right-radius:0">
<!--秒杀完成-->
<div ng-if="pagedata.goods.active.rest_time" ng-class="{'seckill-container':1,'notstart':pagedata.goods.active.status==0}">
    <div class="fui-list seckill-list" style="" >
        <div class="fui-list-media seckill-price">
            &yen;<span>{{pagedata.goods.active.price || pagedata.goods.price}}</span>
        </div>
        <div class="fui-list-inner">
                <div ng-if="pagedata.goods.active.tag" class="text">
                    <span class="stitle" style="white-space:nowrap; overflow:hidden; max-width:2.6rem;">{{pagedata.goods.active.tag}}</span>
                </div>
            <div class="text" ng-if="pagedata.goods.api_data.no_oldprice!=1"><span ng-class="{'oldprice':pagedata.goods.api_data.no_oldpriceline!=1}">{{pagedata.goods.api_data.oldpricetitle || ''}}&yen;{{pagedata.goods.originalprice}}</span></div>
        </div>
    </div>
    <div class="fui-list seckill-list1" ng-if="pagedata.goods.active.nopercent!=1">
        <div class="fui-list-inner">
            <div class="text " ng-if="pagedata.goods.active.status==1">已出售 {{pagedata.goods.active.percent || 0}}%</div>
            <div class="text " ng-if="pagedata.goods.active.status==1"><span class="process"><div class="inner" style="width:{{pagedata.goods.active.percent || 0}}%"></div></span></div>
        </div>
    </div>
    <div class="fui-list seckill-list2">
        <div class="fui-list-inner">
            <div ng-if="pagedata.goods.active.status!=1" class="text ">距开始还有</div>
			<div ng-if="pagedata.goods.active.status==1" class="text ">距结束还有</div>
            <div class="text timer" ng-init="tool.time_down(pagedata.goods.active.rest_time)">
                <span class="time-day" style="width:auto;padding-right:0.1rem">{{pagedata.goods.active.rest_time.day}}天</span>&nbsp;<span class="time-hour">{{pagedata.goods.active.rest_time.hour}}</span>&nbsp;<span class="time-min">{{pagedata.goods.active.rest_time.minute}}</span>&nbsp;<span class="time-sec">{{pagedata.goods.active.rest_time.second}}</span>
            </div>
        </div>
    </div>
</div>
 <!--正常价格-->
    <div class="fui-cell" style='padding-bottom:0;padding-top:0.4rem'>
		<div class="fui-cell-text bold">{{pagedata.goods.title}} <i class="icon icon-yuding syscolor"></i></div>
		<div class="fui-cell-remark lover" style="padding-left:0;margin-top:0.1rem">
			<div class="text">
				<span ng-if="pagedata.goods.active.title" class="red" style="font-size:0.6rem;">{{pagedata.goods.active.title}}</span>
				<span ng-if="!pagedata.goods.active.title && pagedata.setting.price_title" class="red" style="font-size:0.6rem;">{{pagedata.setting.price_title}}</span>
				<span ng-if="pagedata.goods.active.price && !pagedata.goods.active.rest_time" class="price" style="font-size:0.6rem;line-height:1.4rem"> ￥<span style="font-size:1rem;">{{pagedata.goods.active.price ||'0.00'}}</span></span>
				<span ng-if="!pagedata.goods.active.price" class="price" style="font-size:0.6rem;line-height:1.4rem"> ￥<span style="font-size:1rem;">{{pagedata.goods.price ||'0.00'}}</span></span>
			</div>
		</div>
    </div>
	<div class="fui-cell">
		<div class="fui-cell-text gray">
			{{pagedata.goods.shorttitle || '未设置短标题'}}
		</div>
		<div class="fui-cell-remark" style="margin-left:0;color:red" ng-click="access_json('jy_weishop/coupon.index/')">
			领券
		</div>
	</div>
	<div class="fui-cell" style="padding:0.5rem">
		<div class="fui-cell-text">
			<div class="jylabels jylabel-red" href="javascript:" ng-click="pagedata.check_buy()">语音咨询</div>
			<div class="jylabels jylabel-red" href="javascript:" ng-click="pagedata.check_buy()">电话咨询</div>
		</div>
		<div class="fui-cell-remark noremark" style="margin-left:0;color:red">	
		</div>
	</div>
	<!-- 平台开卡优惠券 -->
    <div class="fui-cell" ng-if="pagedata.shopset.giftcards_on ==1">
			<div class="fui-cell-text name" ng-click="access_json('jy_weishop/member.getcard/')">
				<span class="fui-tag fui-tag-red-o"><i class="icon jinyunicon icon-bussinesscard" style="font-size:0.4rem;"></i><span style="margin-left:3px">{{pagedata.shopset.giftcards_title ||'免费领'}}</span></span>
                <span class="coupon-mini">{{pagedata.shopset.giftcards_desc || '平台超级卡开卡送120,存100得200。戳'}} <i class="icon jinyunicon icon-yuding" style="font-size:0.5rem;color:red"></i></span>
            </div>
     </div>
</div>
<!-- 所有营销 -->
<div class="fui-cell-group fui-sale-group" style="margin-top:0">
	<!-- 商品可用优惠券 -->
	<div class="fui-cell" ng-if="pagedata.sale==1 && pagedata.coupons.lenght >0" ng-include="sys_html('goods/common/_coupons')"></div>
    <!-- 会员等级 -->
    <div ng-if="pagedata.member.levelname && pagedata.member.isdiscount == 1 && pagedata.member.memberprice != pagedata.goods.price" ng-include="sys_html('goods/common/_memberdiscount')"></div>
    <div ng-if="pagedata.sale==1 && pagedata.huodong == 1" class="fui-cell fui-sale-cell" ng-include="sys_html('goods/common/_sales')"></div>
	<!--赠品-->
    <div ng-if="pagedata.gifts.length >0" class="fui-cell fui-sale-cell sendgoods" ng-click="access_json('jy_weishop/goods.gift//id='+pagedata.goods.gift_id)">
        <div class="fui-cell-label bold" style="width:2rem">赠品</div>
            <div ng-if="pagedata.gifts.length>1" class="fui-cell-text fui-cell-giftclick">
                <label id="gifttitle">请选择赠品</label>
                <input type="hidden" name="giftid" id="giftid" value="">
            </div>
            <div ng-if="pagedata.gifts.length<2" ng-repeat="gi in pagedata.gifts" class='fui-cell-text'>
                    {{gi.title}} <span class="subtitle">&yen;<del>{{gi.price}}</del></span>
            </div>
        <div class="fui-cell-remark noremark"><i class="icon jinyunicon icon-icon-test"></i></div>
    </div>
</div>
<div ng-if="pagedata.goods.merchid==0 && pagedata.stores.length >0 && pagedata.shopset.no_goodsstore!=1" class='fui-according-group' style="border-radius: 0.5rem;" ng-include="sys_html('goods/common/_stores')"></div>
<!--店铺信息-->
<div ng-if="pagedata.shopset.no_goodsshop!=1" ng-include="sys_html('goods/common/_myshop')"></div>
<div class="row" style="background:#f2f2f2;padding:0.2rem 1rem">
	{{pagedata.goods.subtitle}}
</div>
<!--商品详情开始-->
<div class="detail-block" style="position: relative;border-radius: 0.5rem;width:100%;background:#fff;padding-bottom:0">
		<div id="jycontent" class="fui-cell-text" style="padding:0.5rem">
			<span class="bold" style="font-size:0.8rem;margin-right:1rem;line-height:1.6;">详细介绍</span>
			<span class="bold syscolor"><i class="icon icon-shoucang-tianchong"></i> 5.0</span>
			<i class="icon icon-zuoshuangxiexian" style="color:#f2f2f2"></i>
			<span class="gray">订单数 <span class="bold syscolor">{{pagedata.goods.salenum}}</span></span>
			<i class="icon icon-zuoshuangxiexian" style="color:#f2f2f2"></i>
		</div>
		<!--购买后显示-->
		<div ng-if="pagedata.goods.isbuynum>0 && pagedata.goods.buyshow==1 && pagedata.goods.buycontent" style="padding:0.4rem 0.5rem;padding-top:0">
			<div class="content-block content-images" ng-bind-html="trust(pagedata.goods.buycontent)"></div>
		</div>
		<div ng-if="pagedata.goods.param.length>0" style="padding:0.4rem 0.5rem;padding-top:0">
			 <div class="fui-cell-group notop" style="background:#f2f2f2;margin-bottom:0.4rem">
				<div ng-repeat="p in pagedata.goods.param" class="fui-cell" style="padding:0.5rem">
					<div class="fui-cell-label md" style="color:#666">{{p.title}}</div>
					<div class="fui-cell-info  md" style="color:#333">{{p.value}}</div>
				</div>
			</div>
		</div>
        <div class="content-block content-images" ng-bind-html="trust(pagedata.goods.content)"></div>
		<div class="content-block content-images" ng-bind-html="trust(pagedata.goods.footerinfo)"></div>
</div>
<div ng-include="sys_html('shop/_zxout_time')"></div>
<div class="row" style="background:#f2f2f2;padding:0.2rem 1rem">
	<div class="fui-tab-scroll" style="">
		<div class="item on bold" style="padding:0;height:2rem;line-height:2rem;color:#333">评价</div>
		<div class="item" style="line-height:2rem;color:{{main.syscolor || 'red'}}">{{pagedata.commentsnum}}单</div>
	</div>
</div>
<div ng-include="sys_html('goods/comments','','','jy_weishop')"></div>
<div ng-if="!pagedata.loading && (!pagedata.list || pagedata.list.length<1)" class='content-empty' style="margin-top:0">
	<i class='icon icon-chakanpingjia' style="font-size:1.5rem"></i><br/>暂时没有评价
</div>
</div>
<div ng-if="pagedata.showtype==4">
	<!--服务须知-->
	<div class="detail-block" style="position: relative;border-radius: 0.5rem;width:100%;background:#fff;padding-bottom:0">
        <div class="content-block content-images" ng-bind-html="trust(pagedata.buyxieyi.content)"></div>
	</div>
</div>
</div>
</div>
<!-- 下面是弹窗系列 -->
<!--赠品弹层-->
<div ng-if="pagedata.isgift==1 && pagedata.goods.total>0" id='gift-picker-modal' style="margin:-100%;" ng-include="sys_html('goods/common/_giftmodal')"></div>
<!--配送区域弹层-->
<div id="showhas_city" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0;bottom:0">
<div class="modal-bottom">
    <div class='city-picker'>
        <div ng-if="pagedata.dispatch.isdispatcharea==0" class='fui-cell-title text-center' style="background: white;">不配送区域</div>
        <div ng-if="pagedata.dispatch.isdispatcharea==1" class='fui-cell-title text-center' style="background: white;">只配送区域</div>
        <div class="fui-cell-group fui-sale-group" style="margin-top:0; overflow-y: auto;padding:0.5rem">
            <span ng-repeat="(ke,v) in pagedata.citys" class="fui-tag fui-tag-red-o sale-tip" style="margin:0.2rem">{{ke}}</span>
        </div>
    </div>
	<div class="fui-navbar" style="padding:0.35rem 1rem">
			<a href="javascript:;" aria-hidden="true" data-dismiss="modal" class="nav-item btn btn-danger confirmbtn">确定</a>
	</div>
</div>
</div>
</div>
<!-- 促销活动层 -->
<div id="showhuodong" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0;bottom:0">
<div class="modal-bottom">
    <div class='picker-sales page-goods-detail'>
        <div class='fui-cell-title text-center' style="background: white;">活&nbsp;动</div>
        <div class="fui-cell-group fui-sale-group noborder" style="margin-top:0; overflow-y: auto;">
            <!-- 商城满减 -->
				<div ng-if="pagedata.saleset.enough.length>0">
                <div  class="fui-cell fui-sale-cell">
                    <div class="fui-cell-label" style="width:2rem">
                        <span class="fui-tag-red-big-o sale-tip">满减</span>
                    </div>
                    <div class="fui-cell-text" style="white-space: inherit;">
                        <div ng-repeat="(key,enough) in pagedata.saleset.enough">全场 满<span class="text-danger">&yen;{{enough.man}}</span>立减<span class="text-danger">&yen;{{enough.jian}}</span></div>
                    
                    </div>
                </div>
                </div>

            <!-- 商户满减 -->
          
            <div ng-if="pagedata.saleset.enoughdeduct && !pagedata.seckillinfo" class="fui-cell fui-sale-cell">
                <div class="fui-cell-label" style="width:2rem">
                    <span class="fui-tag-red-big-o sale-tip">满减</span>
                </div>
                <div class="fui-cell-text" style="white-space: inherit;">
                  
                    <div ng-repeat="(key,enough) in pagedata.saleset.enoughs">商户 满<span class="text-danger">&yen;{{enough.enough}}</span>立减<span class="text-danger">&yen;{{enough.give}}</span></div>
                  
                </div>
            </div>
           

            <!-- 包邮 -->
			 <div ng-if="pagedata.manjian" class="fui-cell fui-sale-cell">
                    <div class="fui-cell-label" style="width:2rem">
                        <span class="fui-tag-red-big-o sale-tip">包邮</span>
                    </div>
                    <div class="fui-cell-text">
							<div ng-if="pagedata.saleset.baoyou_status ==1">全场满 <span class="text-danger">&yen;{{pagedata.saleset.baoyou_man}}</span> 包邮;</div>
							<div ng-if="pagedata.goods.fullnum>0">单品满 <span class="text-danger">{{pagedata.goods.fullnum}}</span> {{pagedata.goods.unit || '件'}}包邮; </div>
							<div ng-if="pagedata.goods.fullmoney>0">单品满 <span class="text-danger">&yen;{{pagedata.goods.fullmoney}}</span> 包邮; </div>
                        
                    </div>
                </div>	
            <!-- 积分 -->
            <!-- 抵扣 -->
            <div ng-if="pagedata.goods.deduct_credit>0" class="fui-cell fui-sale-cell">
                <div class="fui-cell-label" style="width:2rem">
                    <span class="fui-tag-red-big-o sale-tip">积分抵扣</span>
                </div>
                <div class="fui-cell-text">
                    <div ng-if="pagedata.goods.deduct_credit>0">最高抵扣<span class="text-danger">&yen;{{pagedata.goods.deduct_credit}}</span></div>
                </div>
            </div>
			<!-- 积分 -->
			 <div ng-if="pagedata.goods.credit>0" class="fui-cell fui-sale-cell">
                <div class="fui-cell-label" style="width:2rem">
                    <span class="fui-tag-red-big-o sale-tip">积分</span>
                </div>
                <div class="fui-cell-text">
                    <div>购买赠送<span class="text-danger">{{pagedata.goods.credit}}</span>积分</div>
                </div>
            </div>
			<!-- 虚拟币 -->
            <div ng-repeat="cv in pagedata.goods.credit3" class="fui-cell fui-sale-cell">
                <div class="fui-cell-label" style="width:2rem">
                    <span class="fui-tag-red-big-o sale-tip">{{cv.title}}</span>
                </div>
                <div class="fui-cell-text">
                    购买送 <span class="text-danger">{{cv.credit}}</span>个 {{cv.title}}
                </div>
            </div>
			<!-- 返现 -->
            <div ng-if="pagedata.goods.fang_credit2>0" class="sale-line">
                <span class="fui-tag fui-tag-red-o sale-tip">返现</span>
				  <span class="tag-text">
						购买返现 <span class="text-danger">￥{{pagedata.goods.fang_credit2}}</span> 余额
                </span>
            </div>
            <!-- 二次购买 -->
            
            <div ng-if="pagedata.goods.buyagain>0" class="fui-cell fui-sale-cell">
                <div class="fui-cell-label" style="width:2rem">
                    <span class="fui-tag-red-big-o sale-tip">复购</span>
                </div>
                <div class="fui-cell-text">
                    此商品重复购买可享受<span class="text-danger">{{pagedata.goods.buyagain}}</span>折优惠
					<span ng-if="!pagedata.goods.buyagain_sale"> 
					重复购买 不与其他优惠共享
					</span>
                </div>
            </div> 
            <div ng-if="pagedata.isfullback" class="fui-cell fui-sale-cell">
                <div class="fui-cell-label" style="width:2rem">
                    <span class="fui-tag-red-big-o sale-tip">全返</span>
                </div>
                <div class="fui-cell-text" style="white-space: inherit;">
                    <div class="fullback-info">
                    <p ng-if="pagedata.fullbackgoods.type>0 && pagedata.goods.hasoption > 0 && pagedata.fullbackgoods.minallfullbackallratio == pagedata.fullbackgoods.maxallfullbackallratio" style="display: block;"><i>&yen;</i>全返总额：&yen; {{pagedata.fullbackgoods.minallfullbackallratio}}%
                    <p ng-if="pagedata.fullbackgoods.type>0 && pagedata.goods.hasoption > 0 && pagedata.fullbackgoods.minallfullbackallratio != pagedata.fullbackgoods.maxallfullbackallratio" style="display: block;"><i>&yen;</i>全返总额：&yen; {{pagedata.fullbackgoods.minallfullbackallratio}}% ~ {{pagedata.fullbackgoods.maxallfullbackallratio}}%
                    <p ng-if="pagedata.fullbackgoods.type>0 && pagedata.goods.hasoption <= 0 " style="display: block;"><i>&yen;</i>全返总额： &yen;{{pagedata.fullbackgoods.minallfullbackallratio}}%
                    <p ng-if="pagedata.fullbackgoods.type<=0 && pagedata.goods.hasoption > 0 && pagedata.fullbackgoods.minallfullbackallprice != pagedata.fullbackgoods.maxallfullbackallprice " style="display: block;"><i>&yen;</i>全返总额： &yen;{{pagedata.fullbackgoods.minallfullbackallprice}}
                    <p ng-if="pagedata.fullbackgoods.type<=0 && pagedata.goods.hasoption > 0 && pagedata.fullbackgoods.minallfullbackallprice == pagedata.fullbackgoods.maxallfullbackallprice " style="display: block;"><i>&yen;</i>全返总额： &yen;{{pagedata.fullbackgoods.minallfullbackallprice}} ~ &yen;{{pagedata.fullbackgoods.maxallfullbackallprice}}
                    <p ng-if="pagedata.fullbackgoods.type<=0 && pagedata.goods.hasoption <= 0 " style="display: block;"><i>&yen;</i>全返总额： &yen;{{pagedata.fullbackgoods.minallfullbackallprice}}
                    </p>
					<p ng-if="pagedata.fullbackgoods.type>0 && pagedata.goods.hasoption>0 && pagedata.fullbackgoods.minfullbackratio == pagedata.fullbackgoods.maxfullbackratio" style="display: block;"><i>&yen;</i>每天返:{{pagedata.fullbackgoods.minallfullbackallratio}}%</p>
					<p ng-if="pagedata.fullbackgoods.type>0 && pagedata.goods.hasoption>0 && pagedata.fullbackgoods.minfullbackratio != pagedata.fullbackgoods.maxfullbackratio" style="display: block;"><i>&yen;</i>{{pagedata.fullbackgoods.minallfullbackallratio}}% ~ {{pagedata.fullbackgoods.maxallfullbackallratio}}%</p>
					<p ng-if="pagedata.fullbackgoods.type>0 && pagedata.goods.hasoption<=0" style="display: block;"><i>&yen;</i>每天返:{{pagedata.fullbackgoods.fullbackratio}}%</p>
					<p ng-if="pagedata.fullbackgoods.type<=0 && pagedata.goods.hasoption>0 && pagedata.fullbackgoods.minfullbackprice == pagedata.fullbackgoods.maxfullbackprice" style="display: block;"><i>&yen;</i>每天返:&yen;{{pagedata.fullbackgoods.minallfullbackallprice}}</p>
					<p ng-if="pagedata.fullbackgoods.type<=0 && pagedata.goods.hasoption>0 && pagedata.fullbackgoods.minfullbackprice != pagedata.fullbackgoods.maxfullbackprice" style="display: block;"><i>&yen;</i>每天返:&yen;{{pagedata.fullbackgoods.minallfullbackallprice}} ~ &yen;{{pagedata.fullbackgoods.maxfullbackprice}}</p>
					<p ng-if="pagedata.fullbackgoods.type<=0 && pagedata.goods.hasoption<=0" style="display: block;"><i>&yen;</i>每天返:&yen;{{pagedata.fullbackgoods.fullbackratio}}</p>
                    <p ng-if="pagedata.goods.hasoption>0 && pagedata.fullbackgoods.minday == pagedata.fullbackgoods.maxday" style="display: block;"><i>&yen;</i>时间：{{pagedata.fullbackgoods.minday}}</p>
                    <p ng-if="pagedata.goods.hasoption>0 && pagedata.fullbackgoods.minday != pagedata.fullbackgoods.maxday" style="display: block;"><i>&yen;</i>时间：{{pagedata.fullbackgoods.minday}} ~ {{pagedata.fullbackgoods.maxday}}</p>
                    <p ng-if="pagedata.goods.hasoption<=0" style="display: block;"><i>&yen;</i>时间：{{pagedata.fullbackgoods.day}}</p>
                    </div>
                  
                    <div ng-if="pagedata.fullbackgoods.startday>0" class="fullback-remark" style="line-height: inherit;">
                        确认收货{{pagedata.fullbackgoods.startday}}天后开始全返。如申请退款，则全返金额退还。
                    </div>
                   
                </div>
            </div>
            
        </div>
		<div class="fui-navbar"  style="padding:0.35rem 1rem">
				<a href="javascript:;" aria-hidden="true" data-dismiss="modal" class="nav-item btn btn-danger confirmbtn">确定</a>
		</div>
    </div>
</div>
</div>
</div>
<div ng-if="pagedata.goods.type ==4" ng-include="sys_html('goods/wholesalePicker')"></div>
<div class='fui-content' ng-if="!pagedata.goods">
    <div class='content-empty'>
        <i class='icon icon-searchlist'></i><br/> 商品已经下架，或者已经删除!<br/><a href="{php echo mobileUrl()}" class='btn btn-default-o external'>到处逛逛</a>
    </div>
</div>
<!--分享弹层-->
<div id="showsharecover" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0;top:0">
	<div id="cover">
		<div class='fui-mask-m visible'></div>
		<div class='arrow'></div>
		<div ng-if="!pagedata.goods.share_title" class='content'>请点击右上角<br/>通过【发送给朋友】<br/>邀请好友购买</div>
		<div ng-if="pagedata.goods.share_title" class='content'>请点击右上角<br/>通过【发送给朋友】<br/>邀请好友购买{{pagedata.goods.share_title}}</div>
	</div>
</div>
</div>
<!--优惠券弹层完成-->
<div ng-include="sys_html('coupon/common/_couponpicker')"></div>

</div>
<!--底部按钮-->
<div class="fui-navbar-tip" ng-if="pagedata.shopset.open_tips==1"><i class="icon icon-information" style="font-size:0.6rem;color:red"></i> {{pagedata.shopset.tips}}</div>
<div class="fui-navbar bottom-buttons">
	<a ng-if="pagedata.shopset.nokefu2!=1" class="nav-item favorite-item active" ng-click="pagedata.itemtokefu();">
        <span class="icon jinyunicon icon-xiaoxi1" style="color:{{main.syscolor||'red'}};"></span>
        <span class="label" >客服</span>
    </a>
	<a ng-if="pagedata.goods.myshopmid>0 && pagedata.goods.merchid ==0" class="nav-item external" href="javascript:" ng-click="access_json('jy_commission/myshop//mid='+pagedata.goods.myshopmid)">
        <span class="icon jinyunicon icon-dianpu"></span>
        <span class="label" >小店</span>
    </a>
	<a ng-if="pagedata.goods.merchid>0" class="nav-item external" href="javascript:" ng-click="access_json('jy_merch/myshop//id='+pagedata.goods.merchid)">
        <span class="icon jinyunicon icon-dianpu"></span>
        <span class="label" >小店</span>
    </a>
	<a ng-if="pagedata.goods.merchid==0 && pagedata.goods.myshopmid==0" class="nav-item external" href="javascript:" ng-click="access_json(main.menus[0].action || 'jy_weishop/index/')">
        <span class="icon jinyunicon icon-dianpu"></span>
        <span class="label" >首页</span>
    </a>
	<a class="nav-item btn cartbtn seckill-notstart" ng-if="!pagedata.post.isdish && pagedata.seckillinfo &&  pagedata.seckillinfo.status==1 && pagedata.goods.canbuy" href="javascript:" ng-click="pagedata.check_buy()">
		<div class="fee-tag-nav">
			原价购买
		</div>
	</a>
	<a class="nav-item btn buybtn" ng-if="!pagedata.post.isdish && !pagedata.selespename && (!pagedata.seckillinfo ||  pagedata.seckillinfo.status!=1) && pagedata.goods.canbuy" href="javascript:" ng-click="pagedata.check_buy()">
		<div class="fee-tagup-nav">
			{{pagedata.setting.buy_title || '立刻购买'}}
		</div>
	</a>
	<a class="nav-item btn buybtn" ng-if="!pagedata.post.isdish && pagedata.selespename && (!pagedata.seckillinfo ||  pagedata.seckillinfo.status!=1) && pagedata.goods.canbuy" href="javascript:" ng-click="pagedata.isfromcart=0;pagedata.showpicker=true;">
		<div class="fee-tagup-nav">
			{{pagedata.setting.buy_title || '立刻购买'}}
		</div>
	</a>
	<a class="nav-item btn cartbtn disabled" ng-if="!pagedata.goods.canbuy"  href="javascript:">
		<div class="fee-disabled-nav">
			{{pagedata.goods.nobuytitle}}
		</div>
	</a>
</div>
<!--分享二维码弹层-->
<div id="showsharecode" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0;bottom:0">
<div class="modal-bottom">
    <div ng-if="pagedata.commission_data.codeShare==1" class="alert-content">
        <div class="alert" style="padding:0;">
            <i class="alert-close alert-close1 icon icon-close"></i>
            <div class="fui-list alert-header" style="-webkit-border-radius: 0.3rem;border-radius: 0.3rem;padding:0;">
                <img ng-src="{{tomedia(pagedata.goodscode)}}" width="100%" height="100%" class="alert-goods-img" alt="">
            </div>
        </div>
    </div>

    <div ng-if="pagedata.commission_data.codeShare==2" class="alert-content">
        <div class="alert2">
            <div class="fui-list alert-header" style="-webkit-border-radius: 0.3rem;border-radius: 0.3rem;padding:0;">
                <img ng-src="{{tomedia(pagedata.goodscode)}}" width="100%" height="100%" class="alert-goods-img" alt="">
            </div>
        </div>
    </div>

    <div ng-if="pagedata.commission_data.codeShare!=1 && pagedata.commission_data.codeShare!=2" class="alert-content">
        <div class="alert" style="padding:0;background: #f5f4f9;border:none;-webkit-border-radius: 0.3rem;border-radius: 0.3rem;top:2rem;">
            <i class="alert-close alert-close1 icon icon-close" style="right: -0.7rem;top: -0.8rem;background: #e1040d;border:none;z-index:10"></i>
            <div class="fui-list alert-header" style="-webkit-border-radius: 0.3rem;border-radius: 0.3rem;padding:0;">
                <img ng-src="{{tomedia(pagedata.goodscode)}}" class="alert-goods-img" alt="">
            </div>

        </div>
    </div>
</div>
</div>
</div>
<div id="modal_address"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:100%;left:0;bottom:0">
	<div class="modal-bottom">
		<div ng-if="pagedata.isadd_address!=1" class="fui-content" style="background:#fff">
			<div class="fui-cell-title text-center">送至</div>
			<div ng-if="pagedata.address_list.length" class="fui-list-group address-item modal-swiper-y">
				<div class="fui-list" ng-repeat="item in pagedata.address_list">
					<div class="fui-list-inner">
						<div class="title red"><span class='realname'>{{item.name}}</span> <span class='mobile'>{{item.mobile}}</span></div>
						<div class="text red"><span class='address'>{{item.pcd.province}}&nbsp{{item.pcd.city}}&nbsp{{item.pcd.district}}&nbsp{{item.address}}</span></div>
					</div>
					<div class='fui-list-angle'>
                        <label class='radio-inline'>
							<input type="radio" class="fui-radio  fui-radio-danger" ng-checked="pagedata.address.id == item.id" ng-click="pagedata.change_address(item.id)"/>
						</label>
                    </div>
				</div>
			</div>
			<div ng-if="!pagedata.address_list.length" class='content-empty' style="margin:0">
				<i class='icon jinyunicon icon-search'></i><br/> 您还没有地址？~ 添加一个吧 ~<br/><a ng-click="pagedata.isadd_address=1" class="btn btn-sm btn-default-o external" style="margin-top:0.5rem">添加地址</a>
			</div>
			<div ng-if="pagedata.address_list.length" class="fui-navbar"  style="padding:0.35rem 1rem">
				<a href="javascript:;" aria-hidden="true" data-dismiss="modal" class="btn btn-danger btn-banf" style="margin:0;width:100%">确定</a>
			</div>
		</div>
		<div ng-if="pagedata.isadd_address==1" class="fui-content" style="background:#fff">
			<div class="fui-cell-title text-center">添加地址</div>
			<div class='fui-cell-group'>
                <div class='fui-cell'>
                    <div class='fui-cell-label'>收件人</div>
                    <div class='fui-cell-info'><input type="text" ng-model="pagedata.address.name" placeholder="收件人" class="fui-input"/></div>
                </div>
                <div class='fui-cell'>
                    <div class='fui-cell-label'>联系电话</div>
                    <div class='fui-cell-info'><input type="tel" ng-model="pagedata.address.mobile" placeholder="联系电话"  class="fui-input"/></div>
                </div>

                <div class="fui-cell">
					<div class="fui-cell-label ">地区</div>
					<div class="fui-cell-label" style="width:28%">
						<select ng-model="pagedata.address.pcd.province" class="form-control tpl-province">
						<option value="" selected="selected">省份</option>
						<option ng-repeat="(value,data) in pagedata.province" value="{{value}}" ng-selected="pagedata.address.pcd.province==value">{{value}}</option>
						</select>
					</div>
					<div class="fui-cell-label" style="width:28%">
						<select ng-model="pagedata.address.pcd.city" class="form-control tpl-city">
						<option value="" selected="selected">城市</option>
						<option ng-repeat="(value,data) in pagedata.province[pagedata.address.pcd.province]" value="{{value}}" ng-selected="pagedata.address.pcd.city==value">{{value}}</option>
						</select>
					</div>
					<div class="fui-cell-label" style="width:28%">
						<select ng-model="pagedata.address.pcd.district" class="form-control tpl-district">
						<option value="" selected="selected">区县</option>
						<option ng-repeat="(value,data) in pagedata.province[pagedata.address.pcd.province][pagedata.address.pcd.city]" value="{{value}}" ng-selected="pagedata.address.pcd.district==value">{{value}}</option>
						</select>
					</div>
					<div class="fui-cell-label" style="width:28%">
						<select ng-model="pagedata.address.pcd.street" class="form-control tpl-district">
						<option value="" selected="selected">街道</option>
						<option ng-repeat="value in pagedata.province[pagedata.address.pcd.province][pagedata.address.pcd.city][pagedata.address.pcd.district]" value="{{value}}" ng-selected="pagedata.address.pcd.street==value">{{value}}</option>
						</select>
					</div>
				</div>
                <div class='fui-cell'>
                    <div class='fui-cell-label'>详细地址</div>
                    <div class='fui-cell-info'><input type="text" ng-model="pagedata.address.address" placeholder='街道，楼牌号等'  class="fui-input"/></div>
                </div>
            </div>
			<div class="fui-navbar"  style="padding:0.35rem 1rem">
				<a ng-click="pagedata.add_address();" class="btn btn-danger btn-banf" style="margin:0;width:100%">确定</a>
			</div>
		</div>
	</div>
	</div>
</div>
<div ng-if="pagedata.showpicker" class="popup">
        <div class="popup-body">
            <div class="popup-bottom">
                <i class="closed icon icon-cuowu" ng-click="pagedata.showpicker=false"></i>
                <div ng-include="sys_html('goods/picker')"></div>
            </div>
        </div>
</div>
<div id="showstoreitem"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:100%;left:0;bottom:0">
		<div class="modal-bottom">
			<div class="fui-cell-group">
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:100px;font-size:0.9rem">{{pagedata.storeitem.title}}</div>
				</div>
				<div class="fui-cell noborder">
					<div class="fui-cell-label bold" style="width:80px;">地址：</div>
					<div class="fui-cell-info">{{pagedata.storeitem.pcd.province}} {{pagedata.storeitem.pcd.city}} {{pagedata.storeitem.pcd.district}} {{pagedata.storeitem.pcd.street}} {{pagedata.storeitem.address}}</div>
				</div>
				<div class="fui-cell noborder">
					<div class="fui-cell-label bold" style="width:80px;">联系人：</div>
					<div class="fui-cell-info">{{pagedata.storeitem.realname}}</div>
				</div>
				<div class="fui-cell noborder">
					<div class="fui-cell-label bold" style="width:80px;">联系电话：</div>
					<div class="fui-cell-info">{{pagedata.storeitem.mobile}}</div>
				</div>
			</div>
			<div class="fui-navbar" style="padding:0.35rem 1rem">
				<a href="javascript:;"  aria-hidden="true" data-dismiss="modal" class="btn btn-danger btn-banf" style="margin:0;width:100%">关闭</a>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.showshareall" class="popup">
	<div class="popup-body">
		<div class="popup-bottom" style="min-height:auto;padding-bottom:3rem">
			<div class="fui-cell-group">
				<div ng-if="pagedata.shopset.tj_hwq==1" class="fui-cell">
					<div class="fui-cell-text c">
						<div class="text bold" ng-click="pagedata.tj()" style="font-size:0.8rem"><i class="icon icon-good"></i> 推荐好物</div>
						<div class="c" style="color:#999">(分享到好物圈)</div>
					</div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-text c">
						<div class="text bold" onclick="$('#showsharecover').modal();" style="font-size:0.8rem">发送给朋友</div>
					</div>
				</div>
				<div ng-if="pagedata.goods.isposter==1" class="fui-cell">
					<div class="fui-cell-text c">
						<div class="text bold" ng-click="pagedata.showposter=true;pagedata.upposter()" style="font-size:0.8rem">生成海报</div>
					</div>
				</div>
			</div>
			<div class="fui-navbar"  style="padding:0.35rem 1rem">
				<a href="javascript:;" ng-click="pagedata.showshareall=false;pagedata.showposter=false" class="btn btn-danger btn-banf" style="margin:0;width:100%">取消</a>
			</div>
		</div>
		<div ng-if="pagedata.showposter" class="popup-center" style="width:70%;top:42%">
			<div class="fui-content c" style="height:auto;border: 1px solid #fdd8d6;border-radius:0.3rem;padding-bottom:0;background:#fff">
				<img ng-src="{{pagedata.posterimg || '../core/resource/images/nopic.jpg'}}" style="border-radius:0.3rem;width:100%;height:auto"/>
				<a class="btn btn-sm btn-danger-o external" style="line-height: 1.1rem;border-radius:1rem;margin:0.2rem;font-size:0.65rem;">长按保存图片</a>
			</div>
		</div>
	</div>
</div>
<div id="attention" ng-if="pagedata.showqrcode==1">
	<div class="attention-alert" style="width:80%;left:10%">
					<div class="attention-content" style="padding: 1.5rem 0;background:none;height:auto">
						<div class="col-jy-1" style="text-align: center;">
							<img ng-src="{{tomedia(pagedata.kefuqr) || '../core/resource/images/nopic.jpg'}}" alt=""style="width: 100%">
						</div>
						<p >长按指纹识别图中二维码</p>
					</div>
					<i class="icon icon-cuowu" ng-click="pagedata.showqrcode=0" style="font-size:1.5rem;color:#fff;position: absolute;top:105%;left:45%"></i>
	</div>
</div>
<!--弹目-->
<div ng-if="pagedata.showtanmus && !pagedata.pluginset.no_tanmu" class="video-sms-pane {{pagedata.transition?'transition':''}}">
		<div class="video-sms-text">
			<image class="video-sms-logo" ng-src="{{pagedata.tanmus[pagedata.nowmsgid].avatar}}"/>
			<span class="overflow-h"> 最新订单来自 {{pagedata.tanmus[pagedata.nowmsgid].nickname}}</span>
		</div>
</div>
<style type="text/css">
    .share-text1{text-align: center;padding:0.5rem 0.5rem 0;font-size:0.6rem;color:#666;line-height: 1rem;}
    .share-text2{text-align: center;padding:0 0.5rem 0.5rem;font-size:0.6rem;color:#666;line-height: 1rem;}
</style>
<div ng-include="sys_html('shop/_libaos')"></div>
<div ng-include="sys_html('shop/_selectstores')"></div>
<div ng-include="sys_html('common/_sales')"></div>
<script type="text/javascript">
scope.pagedata.nodata_pic='../core/resource/images/goods_nodata.jpg';
scope.pagedata.tj=function(){
	var jsCheckObject={
		'appid':jssdkconfig.appId,
		'timestamp':jssdkconfig.timestamp,
		'noncestr':jssdkconfig.nonceStr,
		'signature':jssdkconfig.signature,
		'url':scope.pagedata.goods.url
		};
	if(scope.pagedata.goods.status==0){
		var status =2;
	}else if(scope.pagedata.goods.status==2){
		var status =3;
	}else{
		var status =1;
	}
	var sku={
		'sku_id':scope.pagedata.goods.id, 
		'price':(scope.pagedata.goods.price)*100,
		'original_price':(scope.pagedata.goods.originalprice)*100,
		'status':status
	}
	var productObject={
		'item_code':scope.pagedata.goods.id,
		'title':scope.pagedata.goods.title,
		'desc':scope.pagedata.goods.subtitle,
		'category_list':scope.pagedata.jy_hwqset.category_list?scope.pagedata.jy_hwqset.category_list:{"category_id": 4342,"category_name": "运动裤"}, //类目列表
		'image_list':scope.pagedata.images,
		'src_h5_path':scope.pagedata.url,
		'sku_list':sku,
		
	};
	//console.log(productObject)
	var jsCheckObject1 = encodeURIComponent(JSON.stringify(jsCheckObject))
	var productObject1 = encodeURIComponent(JSON.stringify(productObject))
	wx.openBusinessView({
	  businessType: 'friendGoodsRecommend',
	  queryString: 'jsCheck='+jsCheckObject1+'&product='+productObject1,
	  success: function (res) {
	  //{"err_msg":"errmsg","extraData":{}}
	  },
	  fail: function (res){
		scope.message(res.errMsg);
	  // alert('请检查参数配置或者公众号权限');
	  //{"err_msg":"errmsg"}
	  }
	})
}
//滚动加载
scope.pagedata.scroll_bottom=function(){
	if(scope.pagedata.showtype==0){
		if(scope.pagedata.scroll_bottomtimes){
			scope.pagedata.scroll_bottomtimes++
		}else{
			scope.pagedata.scroll_bottomtimes=1;
		}
		if(scope.pagedata.scroll_bottomtimes==1){
			scope.pagedata.showupto = 1
		}
	}
}
scope.pagedata.goDetail=function(id){
	scope.pagedata.showtype = 0;
	scope.pagedata.showpingjia=0;
	if(id=='jycontent'){
		scope.pagedata.showtype = 2;
	}
	if(id=='jytuijie'){
		scope.pagedata.showtype = 3;
	}
	if(id=='jypingjia'){
		scope.pagedata.showtype = 1;
		scope.pagedata.showpingjia=1;
		id='jyindex';
	}
	scope.$evalAsync();
	setTimeout(function(){
		var element = document.getElementById(id);
		element.scrollIntoView();
		element.scrollIntoView(false);
		element.scrollIntoView({block: "start"});
		element.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"});
	},200);
}
//减少
scope.pagedata.minus=function(){
	if(scope.pagedata.post.num <=1){
		return false;
	}
	scope.pagedata.post.num--;
	scope.$evalAsync();
}
//增加
scope.pagedata.plus=function(){
	if(parseInt(scope.pagedata.goods.usermaxbuy)>0 && parseInt(scope.pagedata.goods.order_goodscount) + parseInt(scope.pagedata.post.num)>=parseInt(scope.pagedata.goods.usermaxbuy)){
		scope.message('不能再加了，你已购买'+scope.pagedata.goods.order_goodscount+'件，超过该商品最大购买量'+scope.pagedata.goods.usermaxbuy+'！','error');
		return false;
	}
	if(parseInt(scope.pagedata.goods.maxbuy)>0 && parseInt(scope.pagedata.post.num)>=parseInt(scope.pagedata.goods.maxbuy)){
		scope.message('不能再加了，超过该商品单次购买'+scope.pagedata.goods.maxbuy+'量！','error');
		return false;
	}
	if(parseInt(scope.pagedata.post.num)>=parseInt(scope.pagedata.options.stock)){
		scope.message('不能再加了，超了库存'+scope.pagedata.options.stock+'啦！','error');
		return false;
	}
	scope.pagedata.post.num++;
	scope.$evalAsync();
}
//选择
scope.pagedata.get_optionsid=function(){
	var specid = scope.pagedata.post.specid;
		specid = specid.join('_');
	scope.post_json('jy_weishop/goods.detail/get_optionsid/',{'specid':specid},function(res){
			console.log(specid);
			scope.pagedata.post.optionsid=res.options.id;
			scope.pagedata.options=res.options;
			scope.pagedata.goods.price=res.options.price;
			scope.pagedata.goods.image=res.options.thumb?res.options.thumb:scope.pagedata.goods.image;
			scope.pagedata.goods.originalprice=res.options.productprice;
			scope.pagedata.selespename=res.selespename;
			scope.$evalAsync();
	});
}
scope.pagedata.add_address=function(){
	scope.pagedata.address.res=1
	scope.pagedata.isadd_address=0;
	scope.post_json('core/member.address/post/',scope.pagedata.address,function(res){
			scope.pagedata.post.addressid =res;
			$('#modal_address').modal('hide');
			scope.$evalAsync();
	});
}
//选择地址
scope.pagedata.change_address=function(id){
	scope.post_json('jy_weishop/goods.detail/change_address/',{'addressid':id},function(res){
			scope.pagedata.post.addressid=res.address.id;
			scope.pagedata.address=res.address;
			scope.$evalAsync();
	});
}
//获取关注
scope.pagedata.setlike=function(){
	scope.post_json('jy_weishop/goods.detail/like/',{},function(res){
		scope.message(res);
	});
}
//加入清单
scope.pagedata.addqingdan=function(){
	scope.post_json('jy_weishop/sale.qingdan/add/',{'goodsid':scope.pagedata.goods.id},function(res){
		scope.message(res);
	});
}
//if(scope.pagedata.goods.type==3 || (scope.pagedata.goods.type==0 && scope.pagedata.goods.isverify==1)){
	scope.pagedata.getstores=function(lat_lng){
		var id=scope.pagedata.goods.id;
		scope.post_json('/get_data/getstores/',{'lat_lng':lat_lng,'id':id},function(res){
				scope.pagedata.stores =res.stores
				scope.pagedata.stores_count =res.stores_count
				if(!scope.pagedata.post.storeid){
					scope.pagedata.post.storeid = res.stores[0]?res.stores[0].id:0;
				}
				scope.$evalAsync();
		});
	}
	// 百度地图API功能
	if(!scope.pagedata.lat_lng && !scope.main.lat_lng){
		scope.pagedata.setting=scope.pagedata.setting?scope.pagedata.setting:{}
		window.scope.location(function(re){
			scope.main.lat_lng=re.lat_lng;
			scope.main.pcd=re.addressComponents;
			scope.pagedata.getstores(re.lat_lng);
		},scope.pagedata.setting.no_location);
	}else{
		scope.pagedata.getstores(scope.pagedata.lat_lng);
	}
//}
scope.pagedata.showstoreitem=function(){
	$('#showstoreitem').modal();
}
scope.pagedata.check_buy=function(){
	var goodsid=scope.pagedata.post.goodsid
	var num=scope.pagedata.post.num
	var optionsid=scope.pagedata.post.optionsid
	var addressid=scope.pagedata.post.addressid
	var storeid=scope.pagedata.post.storeid
	var dayid=scope.pagedata.post.dayid
	var out_time=scope.pagedata.post.out_time?scope.pagedata.post.out_time:'';
	scope.get('jy_weishop/goods.detail/check_buy/isresurl=1&goodsid='+goodsid+'&num='+num+'&optionsid='+optionsid+'&addressid='+addressid+'&storeid='+storeid+'&dayid='+dayid+'&out_time='+out_time,function(resurl){
		scope.access_json(resurl);
	});
}
</script>
<script>
scope.pagedata.issocketmsg=false;
scope.pagedata.tanmuspage=0;
scope.pagedata.isa2=true;
scope.pagedata.isno_coupontop=1;
scope.pagedata.gettanmus=function() {
	if(!scope.pagedata.issocketmsg){
			scope.pagedata.nowmsgid=0;
			scope.get('jy_weishop/get_data/gettanmus/page='+scope.pagedata.tanmuspage,function(res){
						//console.log(res);
						scope.pagedata.tanmus=res.list
						if(scope.pagedata.tanmus.length>0){
							scope.pagedata.tanmuspage++;
							scope.pagedata.up_oldtanmu();
						}
			});
	}
}
//刚进入时；如果没有新订单消息，就弹储备订单消息
if(scope.pagedata.setting.no_tanmu!=1){
		setTimeout(function(){
			scope.pagedata.gettanmus();
		},2000);
}
scope.pagedata.up_oldtanmu=function() {
		if(scope.page.action=='goods.detail'){
			var i=scope.pagedata.nowmsgid;
			if(i<scope.pagedata.tanmus.length){
				set_tanmu(scope.pagedata.tanmus[i].nickname,scope.pagedata.tanmus[i].avatar,scope.pagedata.tanmus[i].time);
			}else{
				scope.pagedata.gettanmus();
			}
		}else{
			return false;
		}
}
function set_tanmu(nickname,avatar,time) {
		scope.pagedata.nowmsgid++
		scope.pagedata.showtanmus=true
		scope.$evalAsync(scope.pagedata.showtanmus);
		setTimeout(function(){
			scope.pagedata.transition=true
			scope.$evalAsync(scope.pagedata.transition);	
		},300);
		setTimeout(function(){
			scope.pagedata.showtanmus=false
			scope.pagedata.transition=false
			scope.$evalAsync(scope.pagedata.showtanmus);	
		},2000);
		setTimeout(function(){
			//等待5秒，如果没有新的订单消息，就弹储备订单消息
			scope.pagedata.issocketmsg=scope.pagedata.issocketmsg?scope.pagedata.issocketmsg:false;
			if(!scope.pagedata.issocketmsg && scope.page.action=='index'){
				scope.pagedata.up_oldtanmu();
			}
		},4000);
}
scope.tool.get_list('jy_weishop/goods.detail/getcomments/goodsid='+scope.pagedata.goods.id,true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_weishop/goods.detail/getcomments/goodsid='+scope.pagedata.goods.id+'&type='+scope.pagedata.comments_type);
}
scope.pagedata.selectstores=function(item){
	console.log('选择门店'+item.id);
	scope.pagedata.post.storeid=item.id;
	scope.get('jy_weishop/get_data/get_upgoods/storeid='+item.id+'&id='+scope.pagedata.goods.id,function(res){
		scope.pagedata.goods.canbuy=res.canbuy;
		scope.pagedata.selectstore=item;
		scope.$evalAsync();
	});
}
scope.pagedata.itemtokefu=function(){
	if(scope.pagedata.shopset.h5appkf==1 && window.config.fromh5wxapp==1 && window.config.container!='ttapp' && window.config.container!='baiduapp'){
		//H5小程序环境下
		var logo=scope.tomedia(scope.pagedata.account.logo);
		var title=scope.pagedata.account.title
		wx.miniProgram.navigateTo({
			url: '/pages/kefu/index?logo='+logo+'&title='+title
		})
	}else{
		if(scope.pagedata.goods.merchid!=0 && scope.pagedata.goods.merch.showkefu==1){
			scope.access_json('jy_kefu/home//pn=jy_merch&pid='+scope.pagedata.goods.merchid);
		}else if(scope.pagedata.setting.nokefu2!=1 && scope.pagedata.goods.merchid==0 && (!scope.pagedata.shopset.kefutype_h5 || scope.pagedata.shopset.kefutype_h5==0)){
			scope.access_json(pagedata.shopset.kflink);
		}else if(scope.pagedata.setting.nokefu2!=1 && scope.pagedata.goods.merchid==0 && scope.pagedata.shopset.kefutype_h5==1){
			scope.pagedata.kefuqr=scope.pagedata.shopset.kf_accountimg;
			scope.pagedata.showqrcode=1;
		}else if(scope.pagedata.setting.nokefu2!=1 && scope.pagedata.goods.merchid==0 && scope.pagedata.shopset.kefutype_h5==2){
			scope.access_json(scope.pagedata.shopset.appkflink)
		}else if(scope.pagedata.setting.nokefu2!=1 && scope.pagedata.goods.merchid==0 && scope.pagedata.shopset.kefutype_h5==3){
			scope.access_json(scope.pagedata.shopset.workerh5url);
		}else if(scope.pagedata.setting.nokefu2!=1 && scope.pagedata.goods.merchid==0 && scope.pagedata.shopset.kefutype_h5==4){
			scope.pagedata.kefuqr=scope.pagedata.shopset.guwenkfewm;
			scope.pagedata.showqrcode=1;
		}
		scope.$evalAsync();
	}
}
scope.pagedata.pickeraddtocart=function(){
    scope.post_json('jy_weishop/goods.detail/addtocart/isres=1',scope.pagedata.post,function (res){
        scope.message('成功加入购物车！');
        scope.pagedata.cartnums=res.cartnums;
        scope.pagedata.cartCount=res.cartnums;
        if(scope.main.menus && scope.main.menus.length>0){
            for(var i=0;i<scope.main.menus.length;i++){
                var action=scope.main.menus[i].action
                if(action.indexOf("jy_weishop/member.cart") != -1){
                    var key=i;
                    scope.main.menus[key].nums=scope.pagedata.cartnums
                }
            }
        }
        scope.pagedata.showpicker=false
        scope.$evalAsync();
    })
}
scope.pagedata.upposter=function(){
	scope.get('jy_weishop/goods.detail/upposter/goodsid='+scope.pagedata.goods.id,function(res){
		console.log(res)
		scope.pagedata.posterimg=res.posterimg;
		scope.$evalAsync();
	});
}
</script>
<script>
scope.pagedata.gethot_goods=function(isfirst){
	if(isfirst){
			if(!scope.pagedata.params){
				scope.pagedata.params={};
			}
			scope.pagedata.params.page=1;
			scope.pagedata.loaded=false;
	}else if(scope.pagedata.loaded || scope.pagedata.loading){
			return;
	}
	scope.pagedata.loading=true;
	$('#loading_show').show();
	var query=scope.made_query(scope.pagedata.params);
	scope.get('jy_weishop/get_data/gethot_goods/'+query,function(res){
			scope.pagedata.loading=false;
			$('#loading_show').hide();
			if(!scope.pagedata.hot_list || isfirst){
				scope.pagedata.hot_list=[];
			}
			if(res=='none'){
				scope.pagedata.loaded=true;
				return;
			}
			if(!Array.isArray(res)){
				var list=res.list?res.list:[]
			}else{
				var list=res
			}
			if(list.length==0 || (scope.pagedata.psize && list.length<scope.pagedata.psize)){
				scope.pagedata.loaded=true;
			}
			if(list && list != 'null' && list != 'undefined'){
				for(let key in list){
					scope.pagedata.hot_list.push(list[key]);
				}
			}
			scope.pagedata.params.page++;
			scope.$evalAsync();
	});
}
scope.pagedata.gethot_goods(1);
scope.pagedata.getprovince=function(){
	scope.get('jy_weishop/get_data/getprovince/',function(res){
		scope.pagedata.province=res.province;
		scope.$evalAsync();
	});
}
if(scope.main.uplookgoodsurl){
	scope.pagedata.nowmsgid=0;
	scope.main.uplooktime=scope.main.uplooktime?scope.main.uplooktime:10;
	var time=scope.main.uplooktime*1000
	setTimeout(function(){
		console.log('uplookgoodsurl');
		if(scope.main.uplookgoodsurl && scope.page.plugin=='jy_weishop' && scope.page.action=='goods.detail'){
			scope.get(scope.main.uplookgoodsurl,function(res){
				scope.message(res);
			});
		}
		scope.main.uplookgoodsurl=false
	},time);
}
</script>
